
#ifndef  RECOVERY_FS_FILE_FILERANDOMREADER_H
#define  RECOVERY_FS_FILE_FILERANDOMREADER_H

#include <string>
#include <memory>
#include "recovery/fs/file/AbstractFileOperation.h"

namespace recovery {
namespace fs {
namespace file {

class FileRandomReader : public AbstractFileOperation {
public:
    static ErrnoStatus openExist(const std::string & path, std::unique_ptr<FileRandomReader> & reader);

    ~FileRandomReader() override{}

    ErrnoStatus read(char * buf, const size_t len, size_t & readBytes);
protected:
    ErrnoStatus closeOnce() override;
private:
    explicit FileRandomReader(const std::string & path);
};

} //end of namespace file
} //end of namespace fs
} //end of namespace recovery

#endif   /* RECOVERY_FS_FILE_FILERANDOMREADER_H */
